package com.kgc.scd.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * user
 * 用户实体
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "用户表", description = "对应数据库blmall中的user表")
public class User implements Serializable {
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户编号")
    private String userId;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    private String userName;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    private String userPwd;

    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    private String userPhone;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    private String userEmail;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    private String userSex;

    /**
     * 生日
     */
    @ApiModelProperty(value = "生日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date userBirth;

    /**
     * 默认收货地址id
     */
    @ApiModelProperty(value = "默认收货地址id")
    private String userAddrId;

    /**
     * 积分
     */
    @ApiModelProperty(value = "积分")
    private Integer userCredit;

    /**
     * 累计签到天数
     */
    @ApiModelProperty(value = "累计签到天数")
    private Integer userTotalSign;

    /**
     * 连续签到天数
     */
    @ApiModelProperty(value = "连续签到天数")
    private Integer userContinueSign;

    /**
     * 会员id 为空则不是会员
     */
    @ApiModelProperty(value = "会员id")
    private Integer userVipid;

    /**
     * 微信名
     */
    @ApiModelProperty(value = "微信名")
    private String userWxname;

    /**
     * 签到时间
     */
    @ApiModelProperty(value = "签到时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date userSigndate;

    private static final long serialVersionUID = 1L;



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getUserPwd() == null ? other.getUserPwd() == null : this.getUserPwd().equals(other.getUserPwd()))
            && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
            && (this.getUserEmail() == null ? other.getUserEmail() == null : this.getUserEmail().equals(other.getUserEmail()))
            && (this.getUserSex() == null ? other.getUserSex() == null : this.getUserSex().equals(other.getUserSex()))
            && (this.getUserBirth() == null ? other.getUserBirth() == null : this.getUserBirth().equals(other.getUserBirth()))
            && (this.getUserAddrId() == null ? other.getUserAddrId() == null : this.getUserAddrId().equals(other.getUserAddrId()))
            && (this.getUserCredit() == null ? other.getUserCredit() == null : this.getUserCredit().equals(other.getUserCredit()))
            && (this.getUserTotalSign() == null ? other.getUserTotalSign() == null : this.getUserTotalSign().equals(other.getUserTotalSign()))
            && (this.getUserContinueSign() == null ? other.getUserContinueSign() == null : this.getUserContinueSign().equals(other.getUserContinueSign()))
            && (this.getUserVipid() == null ? other.getUserVipid() == null : this.getUserVipid().equals(other.getUserVipid()))
            && (this.getUserWxname() == null ? other.getUserWxname() == null : this.getUserWxname().equals(other.getUserWxname()))
            && (this.getUserSigndate() == null ? other.getUserSigndate() == null : this.getUserSigndate().equals(other.getUserSigndate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getUserPwd() == null) ? 0 : getUserPwd().hashCode());
        result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
        result = prime * result + ((getUserEmail() == null) ? 0 : getUserEmail().hashCode());
        result = prime * result + ((getUserSex() == null) ? 0 : getUserSex().hashCode());
        result = prime * result + ((getUserBirth() == null) ? 0 : getUserBirth().hashCode());
        result = prime * result + ((getUserAddrId() == null) ? 0 : getUserAddrId().hashCode());
        result = prime * result + ((getUserCredit() == null) ? 0 : getUserCredit().hashCode());
        result = prime * result + ((getUserTotalSign() == null) ? 0 : getUserTotalSign().hashCode());
        result = prime * result + ((getUserContinueSign() == null) ? 0 : getUserContinueSign().hashCode());
        result = prime * result + ((getUserVipid() == null) ? 0 : getUserVipid().hashCode());
        result = prime * result + ((getUserWxname() == null) ? 0 : getUserWxname().hashCode());
        result = prime * result + ((getUserSigndate() == null) ? 0 : getUserSigndate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", userName=").append(userName);
        sb.append(", userPwd=").append(userPwd);
        sb.append(", userPhone=").append(userPhone);
        sb.append(", userEmail=").append(userEmail);
        sb.append(", userSex=").append(userSex);
        sb.append(", userBith=").append(userBirth);
        sb.append(", userAddrId=").append(userAddrId);
        sb.append(", userCredit=").append(userCredit);
        sb.append(", userTotalSign=").append(userTotalSign);
        sb.append(", userContinueSign=").append(userContinueSign);
        sb.append(", userVipid=").append(userVipid);
        sb.append(", userWxname=").append(userWxname);
        sb.append(", userSigndate=").append(userSigndate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}